package com.example.practice20240802;

import androidx.annotation.NonNull;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;

/**
 * @author cy
 * @date 2024/8/2
 * @apiNote
 */
public class MyViewModelFactory implements ViewModelProvider.Factory {
    private int count;

    @NonNull
    @Override
    public <T extends ViewModel> T create(@NonNull Class<T> modelClass) {
        return (T) new MyViewModel(count);


    }

    public MyViewModelFactory(int count) {
        this.count = count;
    }
}
